//window.onload=init;
function init(){
	alert('appCodeName:'+navigator.appCodeName+'\n'+'appName:'+navigator.appName+'\n'+'appVersion:'+navigator.appVersion);
	if(navigator.appName === "Microsoft Internet Explorer" ){
		alert('IE内核');
	}else if(navigator.appName === "Netscape"){
		alert('火狐内核');
	}
	alert('页面加载');
	var body = document.body;
	var queryTable = createQueryTable();
	body.appendChild(queryTable);
	//initDataTable(body);
}

function initDataTable(parent){
	var layOutTable = document.createElement('table');
	layOutTable.id = 'layOutTable';
	
	//注意：ie不能直接将tr添加到table中，需要先添加到tbody中
	var tbody = document.createElement('tbody');
	tbody.id = 'tbody';
	
	//第一个tr  td中存放搜索框
	var tr_0_1 = document.createElement('tr');
	var td_0_1 = document.createElement('td');
	
	//第二个tr  td中存放数据框
	var tr_0_2 = document.createElement('tr');
	var td_0_2 = document.createElement('td');
	
	var queryTable = createQueryTable();
	var dataTable = createDataTable();
	
	td_0_1.appendChild(queryTable);
	tr_0_1.appendChild(td_0_1);
	
	td_0_2.appendChild(dataTable);
	tr_0_2.appendChild(td_0_2);
	
	//注意：ie不能直接将tr添加到table中，需要先添加到tbody中
	tbody.appendChild(tr_0_1);
	tbody.appendChild(tr_0_2);
	layOutTable.appendChild(tbody);
	
	parent.appendChild(layOutTable);
}

function createQueryTable(){
	//组织搜索框内容
	var queryTable = document.createElement('table');
	queryTable.id = 'queryTable';
	
	//注意：ie不能直接将tr添加到table中，需要先添加到tbody中
	var tbody = document.createElement('tbody');
	tbody.id = 'tbody';
	
	var tr_1_1 = document.createElement('tr');
	tr_1_1.id = 'tr_1_1';
	var td_1_1 = document.createElement('td');
	td_1_1.id = 'td_1_1';
	
	td_1_1.innerHTML = '请输入查询条件';
	
	//查询输入框
	var queryInput = document.createElement('input');
	queryInput.id = 'queryInput';
	queryInput.name = 'queryInput';
	queryInput.type = 'text';
	
	td_1_1.appendChild(queryInput);
	
	//搜索按钮
	var queryButton = document.createElement('input');
	queryButton.id = 'queryButton';
	queryButton.name = 'queryButton';
	queryButton.type = 'button';
	queryButton.value = '搜索';
	queryButton.onClick = query;
	
	td_1_1.appendChild(queryButton);
	tr_1_1.appendChild(td_1_1);
	
	//注意：ie不能直接将tr添加到table中，需要先添加到tbody中
	tbody.appendChild(tr_1_1);
	queryTable.appendChild(tbody);
	
	return queryTable;
}


function createDataTable(){
	//组织数据框内容
	var dataTable = document.createElement('table');
	dataTable.id = 'dataTable';
	
	return dataTable;
}

